/**
 * 创建岗位服务
 * @param {*} params
 * @returns
 */
const createJobPosition = function (params) {
  return fetch("/api/v1/job-position/create?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 获取岗位树服务
 * @param {*} params
 * @returns
 */
const getJobPositionTree = function (params) {
  return fetch("/api/v1/job-position/tree?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**    
 * 获取岗位列表服务
 * @param {*} params
 * @returns
 */
const getJobPosition = function (params) {
  return fetch("/api/v1/job-position/list?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 编辑岗位服务
 * @param {*} params
 * @returns
 */
const updateJobPosition = function (params) {
  return fetch("/api/v1/job-position/update?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 删除岗位服务
 * @param {*} params
 * @returns
 */
const deleteJobPosition = function (params) {
  return fetch("/api/v1/job-position/delete?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
export default {
  createJobPosition,
  getJobPosition,
  getJobPositionTree,
  updateJobPosition,
  deleteJobPosition,
};
